package testJdk.base.juc_test.multi_threading.lock;

/**
 * @ClassName : learn_jdk.multi_threading.lock.LockTest
 * @Description : 类描述
 * Created by cyd on 2021-03-27 20:23:47
 */
public class LockTest02 {
    public static void main(String[] args) throws InterruptedException {
        B b = new B();
        long start = System.currentTimeMillis();
        for (int i = 0; i < 10000000; i++) {
            b.increase();
        }
        for (int i = 0; i < 10000000; i++) {
            b.increase();
        }
        long end = System.currentTimeMillis();
        System.out.printf("%sms%n", end - start);
        System.out.println(b.getNum());
    }
}
